<?php
header("Content-type:text/html;charset=utf-8");
$mysql = mysqli_connect("localhost","root","root","test");
if(!$mysql){die("未连接到数据库!".mysql_error());}

$id = $_GET['id'];
$delete = mysqli_query($mysql,"DELETE FROM `user` WHERE `id` = $id");
if($delete){
  echo "<script>alert('删除成功!');window.location.href='http://liu.com/yuan/index/index.php';</script>";
}else{
  echo "<script>alert('删除失败!');history.go(-1);</scirpt>";
}
?>
